<%--
  Created by IntelliJ IDEA.
  User: Tec
  Date: 2023/10/16
  Time: 8:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="cn.estore.entity.ProductEntity" %>
<%@ page import="cn.estore.dao.ProductDao" %>
<html style="width: 1024px; margin: 0 auto">
<head>
    <title>商品展示</title>
</head>
<body>
<table border="0" width="100%">
    <tr>
        <td colspan="2">
            <!--此处插入Banner内容-->
            <jsp:include page="common/head.jsp" flush="true"/>
        </td>
    </tr>
    <tr>
        <td style="width: 30%; vertical-align: top;">
            <!--此处插入菜单选择的内容-->
            <jsp:include page="common/left.jsp" flush="true"/>
            "
        </td>
        <td width="70%">
            <!--此处插入查询结果内容-->
            <%
                ProductDao productDao = new ProductDao();
                List<ProductEntity> list = productDao.selectAllProducts();
                for (int i = 0; i < list.size(); i++) {
                    ProductEntity e = (ProductEntity) list.get(i);
            %>
            <table width="95%" height="136" border="1" align="center" cellpadding="1" cellspacing="1"
                   bordercolor="#FFF">
                <tr>
                    <td width="40%" height="80" rowspan="5" bgcolor="#FFF">
                        <div align="center"><img src="<%= "/estore_temp/productImages/" + e.getPicture() %>" width="110"
                                                 height="100"></div>
                    </td>
                    <td width="59%" bgcolor="#f0f8ff">
                        <!-- 商品信息展示 -->
                        <div align="left">商品：<%= e.getName()%>
                        </div>
                        <!-- 单价信息展示 -->
                        <div align="left">单价：<%= e.getMarketPrice()%>元</div>
                        <!-- 商品简介信息展示 -->
                        <div align="left">简介：<%= e.getDescription()%>
                            登录才能购买
                        </div>
                    </td>
                </tr>
            </table>
            <%
                }
            %>
            <br>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <!--此处插入底部内容-->
            <jsp:include page="common/statusBarNavigation.jsp" flush="true"/>
        </td>
    </tr>
</table>
</body>
</html>
